package com.visikard.item;

import java.io.Serializable;

import org.json.JSONObject;

public class ItemAudienceKard implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4629896921410265348L;
	int isTrade;
	int isOnline;
	long fkKard;
	long fkUser;
	int fkKardType;
	String imageSmall;
	String imageLarge;
	String imageMedium;
	String kardName;
	int approved;
	String redeemDate;
	String redeemAt;
	boolean isCheck;
	String comments;
	int rating;

	public ItemAudienceKard(){}
	
	public ItemAudienceKard(JSONObject job){
		if(job == null) return;
		try {
			isTrade = job.optInt("isTrade", -1);
			isOnline = job.optInt("isOnline", 0);
			fkKard = job.optLong("fkKard", -1);
			fkUser = job.optLong("fkUser", -1);
			fkKardType = job.optInt("fkKardType", 0);
			
			imageSmall = job.optString("imageSmall", "");
			if(imageSmall == null || imageSmall.equals("null"))
				imageSmall = "";
			
			imageLarge = job.optString("imageLarge", "");
			if(imageLarge == null || imageLarge.equals("null"))
				imageLarge = "";
			
			imageMedium = job.optString("imageMedium", "");
			if(imageMedium == null || imageMedium.equals("null"))
				imageMedium = "";
			
			kardName = job.optString("kardName", "");
			if(kardName == null || kardName.equals("null"))
				kardName = "";
			
			approved = job.optInt("approved", 0);
			
			redeemDate = job.optString("redeemDate", "");
			if(redeemDate == null || redeemDate.equals("null"))
				redeemDate = "";
			
			redeemAt = job.optString("redeemAt", "");
			if(redeemAt == null || redeemAt.equals("null"))
				redeemAt = "";
			
			comments = job.optString("comments", "");
			if(comments == null || comments.equals("null"))
				comments = "";
			
			rating = job.optInt("rating", 0);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public int getIsTrade() {
		return isTrade;
	}

	public void setIsTrade(int isTrade) {
		this.isTrade = isTrade;
	}

	public int getIsOnline() {
		return isOnline;
	}

	public void setIsOnline(int isOnline) {
		this.isOnline = isOnline;
	}

	public Long getFkKard() {
		return fkKard;
	}

	public void setFkKard(Long fkKard) {
		this.fkKard = fkKard;
	}

	public Long getFkUser() {
		return fkUser;
	}

	public void setFkUser(Long fkUser) {
		this.fkUser = fkUser;
	}

	public int getFkKardType() {
		return fkKardType;
	}

	public void setFkKardType(int fkKardType) {
		this.fkKardType = fkKardType;
	}

	public String getImageSmall() {
		return imageSmall;
	}

	public void setImageSmall(String imageSmall) {
		this.imageSmall = imageSmall;
	}

	public String getImageLarge() {
		return imageLarge;
	}

	public void setImageLarge(String imageLarge) {
		this.imageLarge = imageLarge;
	}

	public String getImageMedium() {
		return imageMedium;
	}

	public void setImageMedium(String imageMedium) {
		this.imageMedium = imageMedium;
	}

	public String getKardName() {
		return kardName;
	}

	public void setKardName(String kardName) {
		this.kardName = kardName;
	}

	public int getApproved() {
		return approved;
	}

	public void setApproved(int approved) {
		this.approved = approved;
	}

	public String getRedeemDate() {
		return redeemDate;
	}

	public void setRedeemDate(String redeemDate) {
		this.redeemDate = redeemDate;
	}

	public String getRedeemAt() {
		return redeemAt;
	}

	public void setRedeemAt(String redeemAt) {
		this.redeemAt = redeemAt;
	}

	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	public int getRating() {
		return rating;
	}

	public void setRating(int rating) {
		this.rating = rating;
	}

	public boolean isCheck() {
		return isCheck;
	}

	public void setCheck(boolean isCheck) {
		this.isCheck = isCheck;
	}
	
}
